<?php
namespace app\controller\api\diy;


use app\FrontendController;
use think\facade\Request;

use app\model\tool\ImageModel;
use app\model\cms\ArticleModel;

use app\model\frontend\SettingModel;
use app\model\frontend\DiyModel;
use app\model\frontend\CategoryModel;
use app\model\frontend\GoodsModel;
class Pc extends FrontendController{

    public function home(Request $request ){

        // return json([]);
        return $this->single( $request );

    }

    public function single( Request $request ){

        // global $_GPC;

        $_GPC = Request::param(  );
        $res = [
            'status'=>0
        ];
        // $diy_id = $request::get('id');

        // $diy = DiyModel::where('id', $diy_id)->find();
        $diy = DiyModel::pc_home();

        if( $diy ){
            $diy['diy'] = json_decode($diy['diy'], true);
            $diy['diy_parse_error'] = json_last_error();
        }



        return json($diy);


    }

}